<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import= "com.roadmap.struts.action.ActionConst"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%
String user_req_id = (String)request.getParameter(ActionConst.Aspirant_Id_In_Request);
if(user_req_id == null){
	user_req_id = "";
}
%>
			<logic:present name="personalStateForm">
			<div class="base-state">
				<table class="state-table">
					<logic:equal name="personalStateForm" property="hasVision" value="false">
					<tr><td class="name-td">
						<span>您还没有规划远景，赶快</span>
						<span><a href="vision.do?act=view&v=edit" >创建</a></span>
						<span>一个吧！</span>
					</td></tr>
					</logic:equal>
					
					<logic:equal name="personalStateForm" property="hasAvailableGoal" value="false">
					<tr><td class="name-td">
						<span>您还没有可执行的目标，赶快</span>
						<span><a href="goal.do?act=create" >创建</a></span>
						<span>一个吧！</span>
					</td></tr>
					</logic:equal>
					
					<logic:equal name="personalStateForm" property="hasAvailablePlan" value="false">
					<tr><td class="name-td">
						<span>您还没有可执行的计划，赶快</span>
						<span><a href="plan.do?act=create" >创建</a></span>
						<span>一个吧！</span>
					</td></tr>
					</logic:equal>
					
					<logic:equal name="personalStateForm" property="hasAvailableTask" value="false">
					<tr><td class="name-td">
						<span>您还没有可执行的任务，赶快</span>
						<span><a href="task.do?act=create" >创建</a></span>
						<span>一个吧！</span>
					</td></tr>
					</logic:equal>					
				</table>
			</div>
			</logic:present>
			
			<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
			<!-- this part can only be viewed by the information owner -->
			<div class="exec-task">
				<div class="task-list">	
					<table cellspacing="10px" class="state-table" onmousemove="RDC.gui.display('taskMgr');" onmouseout="RDC.gui.hide('taskMgr');">
						<tr><th class="prompt" colspan="2"><span class="float-left">今天你执行了吗？</span>
							<span id="taskMgr" class="hover-sp" style="margin-top:4px;">(进入<a href="task.do?act=calendar&uid=<%=user_req_id%>">任务管理</a>)</span></th></tr>
						<tr><td colspan="2"></td></tr>
						<tr><td align="right">选择任务：</td>
							<td align="left">
							<select class="select" style="width:400px;" name="taskList" onchange="showTask();">
								<option value="0">请选择一个任务</option>
								<logic:iterate id="progressStateForm" name="tasks">
									<option value="<bean:write name='progressStateForm' property="id"/>"><bean:write name='progressStateForm' property="describedBy"/></option>
								</logic:iterate>		
							</select>
							</td>
						</tr>						
					</table>
				</div>
				
				<div id="task-exec" class="task-div">	
					<table class="state-table">
						<tr>							
							<td class="name-td"><a name="execTaskLink" href="javascript:void(0);" ><span id="taskContent"></span></a></td>
							<td class="state-td"><span id="taskStatus"></span></td>
							<td class="progress-td"><span id="taskProgress"></span></td>	
							<td class="state-td2"><span id="taskSymptom"></span></td>
						</tr>
					</table>
					
					<table class="state-table">						
						<tr>
							<th colspan="6" class="state-title">
								<span style="margin-right:10px">添加执行记录</span><span id="execMsg" class="prompt-message"></span>
							</th>
						</tr>
						<tr><td ><input type="hidden" name="userid" value="<%=user_req_id%>"/><input type="hidden" name="taskId"/></td></tr>
						<tr>							
							<td class="row-name">执行内容</td>
							<td align="left" colspan="5"><textarea id="content" class="input-text" name="execContent" 
								style="width:400px;height:55px;" title="执行内容(1~200)"></textarea></td>
						</tr>
						<tr>
							<td class="row-name">执行日期</td>
							<td align="left" width="60px"><input id="executeDate" class="shortDate" type="text" title="执行日期(yyyy-MM-dd)" 
																name="execDate" maxlength="10" onfocus="datePicker.showWith(this);"/></td>
							<td class="row-name">执行时长</td>
							<td align="left"><input id="executeTimeLength" class="input-text" type="text" title="执行时长(1~24)" 
																name="execTimeLength" size="4" maxlength="3" />小时</td>
							<td class="row-name">占任务比重</td>
							<td align="left"><input id="proportionOfTask" class="input-text" type="text" title="占任务比重(1~100)" 
																name="execPorp" size="4" maxlength="3"/><span>%</span></td>
						</tr>
						<tr>
							<td colspan="6" align="center" style="padding-top: 10px;">
								<input type="button" name="saveExecBtn" class="confirmBtn" value="保存" onclick="saveExec();"/>
								<input type="button" class="cancelBtn" value="取消" onclick="RDC.gui.hide('task-exec');$('taskList').value='0';"/>								
							</td>
						</tr>
					</table>
				</div>
			</div> <!-- <div class="exec-task"> -->
			</logic:present>
			
			<div class="state-detail">
				<table class="state-table" id="fpntable" onmousemove="RDC.gui.display('fbPlanMgr');" onmouseout="RDC.gui.hide('fbPlanMgr');">
					<tr>
						<th colspan="4" class="state-title"><span class="float-left">可执行的计划</span>
							<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
							<span id="fbPlanMgr" class="hover-sp">(进入<a href="plan.do?act=all&uid=<%=user_req_id%>">计划管理</a>)</span>
							</logic:present>
						</th>
					</tr>
					
					<logic:present name="plans">
					<tbody id="executablePlans">
					<logic:iterate id="progressStateForm" name="plans">
					<bean:define id="fpnid" name='progressStateForm' property='id'></bean:define>
					<tr>
						<td class="name-td">
							<input type="hidden" name="pid<%=fpnid %>" value="<%=fpnid %>"/>
							<a href="plan.do?act=view&uid=<%=user_req_id%>&id=<%=fpnid %>" >
								<bean:write name="progressStateForm" property="describedBy"/></a></td>
						<td class="state-td" id="eps<%=fpnid %>"><bean:write name="progressStateForm" property="status"/></td>
						<td class="progress-td" id="epp<%=fpnid %>"><bean:write name="progressStateForm" property="progress"/>%</td>
						<td class="state-td2" id="epy<%=fpnid %>"><bean:write name="progressStateForm" property="symptom"/></td>
					</tr>
					</logic:iterate>
					</tbody>
					</logic:present>
				</table>
				
				<table id="planDetails" class="entryDetails">
					<tr>
						<td class="td1">计划名称</td><td colspan="3" class="td2" id="pd_cotent">飞鹰计划</td>
					</tr>
					<tr>
						<td class="td1">所属目标</td><td colspan="3"  class="td2"><a id="pd_goal" href='goal.do?uid=&id='>月底考100分</a></td>
					</tr>
					<tr>
						<td class="td1">任务数</td><td class="td2" colspan="3"><span id='pd_execount'>10</span> (<a id='pd_tasklink' href='task.do?uid=&pid='>查看</a>)</td>
					</tr>
					<tr>
						<td class="td1">预定开始时间</td><td id='pd_ssd' class="td2">2009-10-20 19:10:18</td>
						<td class="td1">预定结束时间</td><td id='pd_sed' class="td2">2009-10-20 19:10:18</td>
					</tr>
					<tr>
						<td class="td1">实际开始日期</td><td id='pd_rsd' class="td2">2009-09-27</td>
						<td class="td1">实际结束日期</td><td id='pd_red' class="td2">2009-10-20</td>
					</tr>
				</table>
			</div>
			
			<div class="state-detail">
				<table class="state-table" id="ftktable" onmousemove="RDC.gui.display('fbTaskMgr');" onmouseout="RDC.gui.hide('fbTaskMgr');">
					<thead>
						<tr>
							<th colspan="4" class="state-title"><span class="float-left">可执行的任务</span>
								<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
								<span id="fbTaskMgr" class="hover-sp">(进入<a href="task.do?act=calendar&uid=<%=user_req_id%>">任务管理</a>)</span>
								</logic:present>
							</th>
						</tr>
					</thead>
					
					<logic:present name="tasks">
					<tbody id="executableTasks">
						<logic:iterate id="progressStateForm" name="tasks">
						<bean:define id="ftkid" name='progressStateForm' property='id'></bean:define>
						<tr>
							<td class="name-td">
								<input type="hidden" name="tid<%=ftkid %>" value="<%=ftkid %>"/>
								<a href="task.do?act=view&uid=<%=user_req_id%>&id=<%=ftkid %>" >
									<span id="etn<%=ftkid %>"><bean:write name="progressStateForm" property="describedBy"/></span></a>
							</td>
							<td class="state-td" id="ets<%=ftkid %>"><bean:write name="progressStateForm" property="status"/></td>
							<td class="progress-td" id="etp<%=ftkid %>"><bean:write name="progressStateForm" property="progress"/>%</td>
							<td class="state-td2" id="ety<%=ftkid %>"><bean:write name="progressStateForm" property="symptom"/></td>
						</tr>
						</logic:iterate>
					</tbody>
					</logic:present>
				</table>
				
				<table id="taskDetails" class="entryDetails">
					<tr>
						<td class="td1">任务内容</td><td colspan="3" class="td2" id="td_cotent">write a paper at the weekend write a paper at the weekend write a paper at the weekend</td>
					</tr>
					<tr>
						<td class="td1">所属计划</td><td colspan="3" class="td2"><a id="td_plan" href='plan.do?uid=&id='>飞鹰计划</a></td>
					</tr>
					<tr>
						<td class="td1">占计划比重</td><td class="td2"><span id='td_proportion'>20</span>%</td>
						<td class="td1">任务等级</td><td id='td_rank' class="td2">重要不紧急</td>
					</tr>
					<tr>
						<td class="td1">执行记录数</td><td class="td2"><span id='td_execount'>10</span> (<a id='td_execlink' href='exec.do?uid=&pid='>查看</a>)</td>
						<td class="td1">最近执行记录</td><td id='td_newexec' class="td2">2009-10-22 10:45:28</td>
					</tr>
					<tr>
						<td class="td1">预定开始时间</td><td id='td_ssd' class="td2">2009-10-20 19:10:18</td>
						<td class="td1">预定结束时间</td><td id='td_sed' class="td2">2009-10-20 19:10:18</td>
					</tr>
					<tr>
						<td class="td1">实际开始日期</td><td id='td_rsd' class="td2">2009-09-27</td>
						<td class="td1">实际结束日期</td><td id='td_red' class="td2">2009-10-20</td>
					</tr>
				</table>
			</div>

